﻿using Furion;
using Furion.JsonSerialization;

namespace Microsoft.Extensions.Json.Newtonsoft
{
    public static class NewtonsoftJsonConvertExtensions
    {
        public static string Serialize(this object value, object jsonSerializerOptions = null)
        {
            return App.GetService<IJsonSerializerProvider>().Serialize(value, jsonSerializerOptions);
        }

        public static T Deserialize<T>(this string json, object jsonSerializerOptions = null)
        {
            return App.GetService<IJsonSerializerProvider>().Deserialize<T>(json, jsonSerializerOptions);
        }
    }
}
